home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
netdmo.exe
/
USELOG1.FRM
< prev
next >
Wrap
Text File
|
1993-12-10
|
3KB
|
150 lines
Version 1.00
BEGIN Form Uselog1
AutoRedraw = 0
BackColor = QBColor(1)
BorderStyle = 1
Caption = "User Login Script"
ControlBox = -1
Enabled = -1
ForeColor = QBColor(0)
Height = Char(17)
Left = Char(12)
MaxButton = -1
MinButton = -1
MousePointer = 0
Tag = ""
Top = Char(3)
Visible = -1
Width = Char(57)
WindowState = 0
BEGIN ComboBox namebox2
BackColor = QBColor(1)
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(2)
MousePointer = 0
Sorted = 0
Style = 0
TabIndex = 0
TabStop = -1
Tag = ""
Text = ""
Top = Char(1)
Visible = -1
Width = Char(25)
END
BEGIN CommandButton OK1
BackColor = QBColor(7)
Cancel = 0
Caption = "OK"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(36)
MousePointer = 0
TabIndex = 1
TabStop = -1
Tag = ""
Top = Char(2)
Visible = -1
Width = Char(14)
END
BEGIN CommandButton Exit1
BackColor = QBColor(7)
Cancel = 0
Caption = "Exit"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(36)
MousePointer = 0
TabIndex = 2
TabStop = -1
Tag = ""
Top = Char(8)
Visible = -1
Width = Char(14)
END
END
'$FORM Uselog2
'$FORM Netdemo
COMMON SHARED UName$
COMMON SHARED UserID$
TYPE ConInfo
connectnum AS INTEGER
ReturnCode AS INTEGER
ObjectType AS INTEGER
ObjectName AS STRING * 48
END TYPE
TYPE obinfo
ReturnCode AS INTEGER
ObjectType AS INTEGER
ObjectName AS STRING * 47
ObjectID AS STRING * 4
END TYPE
TYPE Obid
StrIn AS STRING * 4
StrOut AS STRING * 8
END TYPE
DECLARE SUB GetConnectionInfo (Info AS ConInfo)
DECLARE SUB GetObjectInfo (ObjectInfo AS obinfo)
DECLARE SUB ConvertObjectID (ID AS Obid)
SUB Exit1_Click ()
uselog1.HIDE
Netdemo.SHOW
END SUB
SUB Form_Load ()
DIM Info AS ConInfo
DIM num1 AS STRING * 4
FOR i% = 1 TO 100
Info.connectnum = i%
CALL GetConnectionInfo(Info) 'Call the Procedure
name$ = RTRIM$(Info.ObjectName$)
strlen% = LEN(name$)
Name2$ = MID$(name$, 3, strlen%) 'Strip the Nul chars.
name1% = INSTR(name$, "NOT-LOGGED-IN")
IF name1% > 0 THEN GOTO notconnected
IF Info.ObjectType = 1 THEN
num1 = STR$(Info.connectnum)
namebox2.ADDITEM num1 + Name2$
namebox2.Listindex = 0
END IF
notconnected:
NEXT i%
END SUB
SUB OK1_Click ()
DIM ObjectInfo AS obinfo
DIM ID AS Obid
name$ = UCASE$(namebox2.text)
strlen% = LEN(name$)
ObjectInfo.ObjectName = MID$(name$, 5, strlen%)
UName$ = ObjectInfo.ObjectName
ObjectInfo.ObjectType = 1
CALL GetObjectInfo(ObjectInfo) 'Call the Procedure
IF ObjectInfo.ReturnCode <> 0 THEN
msg$ = "Invalid User. Please choose a user from the list."
MSGBOX msg$
GOTO NoUser
END IF
ID.StrIn = ObjectInfo.ObjectID
CALL ConvertObjectID(ID)
UserID$ = ID.StrOut
uselog1.HIDE
Uselog2.SHOW
NoUser:
END SUB